package com.sanchunhui.psc.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.sanchunhui.psc.R
import com.sanchunhui.psc.ui.adapter.InformationAdapter
import kotlinx.android.synthetic.main.header.*

/**
 * @Author zyx
 * @Date 2021/4/19-18:34
 * @Dscribe
 */
class InformationFragment : Fragment() {

    lateinit var informationAdapter : InformationAdapter
    lateinit var rvInformation: RecyclerView
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val view = View.inflate(activity, R.layout.fragment_information, null)
        rvInformation = view.findViewById(R.id.rv_information)
        rvInformation.layoutManager = LinearLayoutManager(activity)
        informationAdapter = InformationAdapter(activity)
        rvInformation.adapter = informationAdapter
        return  view
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        initHeader()
    }

    private fun initHeader() {
        headerTitle.visibility = View.VISIBLE
        headerTitle.text = "资讯"
    }


}